package com.fj.springdataelasticsearch.demos.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * @author fj
 * @date 2024/3/18 18:01
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@Document(indexName = "index-fj-article")
public class Article {
    @Id
    private String id;
    @Field(type = FieldType.Text)
    private String title;
    @Field(type = FieldType.Text)
    private String description;
    @Field(type = FieldType.Text)
    private String author;
    @Field(type = FieldType.Double)
    private Double price;
    @Field(type = FieldType.Date)
    private Date publishDate;
    @Field(type = FieldType.Integer)
    private Integer words;
}
